home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / n_b_v203.zip / SCAN.DMO < prev    next >
Text File  |  1996-07-04  |  3KB  |  57 lines

  1. $if 0
  2.     ┌──────────────────────────╖                        PowerBASIC v3.20
  3.  ┌──┤          DASoft          ╟──────────────────────┬──────────────────╖
  4.  │  ├──────────────────────────╢    Copyright 1995    │ DATE: 1995-10-01 ╟─╖
  5.  │  │ FILE NAME   SCAN    .DMO ║          by          ╘════════════════─ ║ ║
  6.  │  │                          ║  Don Schullian, Jr.                     ║ ║
  7.  │  ╘══════════════════════════╝                                         ║ ║
  8.  │ A license is hereby granted to the holder to use this source code in  ║ ║
  9.  │ any program, commercial or otherwise,  without receiving the express  ║ ║
  10.  │ permission of the copyright holder and without paying any royalties,  ║ ║
  11.  │ as long as this code is not distributed in any compilable format.     ║ ║
  12.  │  IE: source code files, PowerBASIC Unit files, and printed listings   ║ ║
  13.  ╘═╤═════════════════════════════════════════════════════════════════════╝ ║
  14.    │                ....................................                   ║
  15.    ╘═══════════════════════════════════════════════════════════════════════╝
  16. $endif
  17.  
  18. '.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
  19. ' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
  20.  
  21. $INCLUDE "DAS-NB01.INC"
  22. COLOR 7, 0
  23. CLS
  24.  
  25. ? "┌────────────────────────────────────────────────────────────
  26. ? "│ fSCANcrlf% ( Start%, ANY )
  27. ? "│ fSCAN%     ( Start%, ANY, Chars?? )
  28. ? "├────────────────────────────────────────────────────────────────
  29. ? "│ Lookin' for something.... maybe we can help find it!
  30. ? "│ These 2 functions are almost the same but fSCANcrlf% is dedicated to
  31. ? "│ finding the `end of line` characters CHR$(13,10) while fSCAN% can be
  32. ? "│ used to detect any 1 or 2 characters. The only flaw in fSCAN% is that
  33. ? "│ it will not detect CHR$(0,X?) but that is a rare occurrence and its
  34. ? "│ speed is worth the difference!
  35. ? "│ Chars?? is best written in HEX as it is much easier to understand when
  36. ? "│ seen printed but is not necessary.
  37. ? "└─────────────────────────────────────────────────────────────────────────
  38. ?
  39. V$ = "This is a test." + CHR$(13,10) + "This is a test."
  40. PRINT V$
  41.  
  42. P1% = fSCAN%( 1, V$, &h0020 )   ' looking for the 1st <SPACE>
  43.       LOCATE 16, P1% : PRINT CHR$(24)
  44.       LOCATE 17, P1% : PRINT "│"
  45.       LOCATE 18, P1% : PRINT "│"
  46.       LOCATE 19, P1% : PRINT "└───────────────────────────────── <space>"
  47.  
  48. P2% = fSCAN%( 1, V$, &h6120 )   ' looking for the 1st "a "
  49.       LOCATE 16, P2% : PRINT CHR$(24,24)
  50.       LOCATE 17, P2% : PRINT "││
  51.       LOCATE 18, P2% : PRINT "└┴──────────────────────────── a<space>"
  52.  
  53. P3% = fSCANcrlf%( 1, V$ )       ' find that "CrLf"
  54.       LOCATE 16, P3% : PRINT CHR$(24,24)
  55.       LOCATE 17, P3% : PRINT "└┴───────────────────── CrLf"
  56.  
  57.